<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ page import="com.cn.bean.Provider "%>
<%@ taglib prefix="page" uri="WEB-INF/jpager.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>蓝天家政系统</title>
<link href="css/style.css" rel="stylesheet">
<link href="css/bootstrap.css" rel="stylesheet">
<script language="javascript">
function check()
{//利用对话框返回的值 （true 或者 false）
    if(confirm("确定要取消该服务供应商的服务资格？"))
   {//如果是
        return true;
    }
    else
    {
        return false;
    }
}
</script>
</head>
<body>
	<div class="navbar navbar-inverse navbar-fixed-top container-fluid">
		<div class="navbar-header">
			<a class="navbar-brand" href="#"><span>蓝天家政</span>系统</a>
			<ul class="user-menu">
				<li class="dropdown pull-right"><a href="#"
					class="dropdown-toggle" data-toggle="dropdown"><img
						src="image/user-white.png"
						style="width: 25%; height: 25%; margin-right: 10%;"><label
						class="user">管理员</label><span class="caret"></span></a>
					<ul class="dropdown-menu" role="menu">
						<li><a href="javascript:void(0)" onclick="a();"> <label
								class="user">详细信息</label></a></li>
						<li><a href="logout.action"> <label class="user">注销</label></a></li>
					</ul></li>
			</ul>
		</div>
	</div>
	<!-- /.container-fluid-->

	<div id="sidebar-collapse" class="col-sm-3 col-lg-2 sidebar">
		<form role="search">
			<div class="form-group">登录成功</div>
		</form>
		<ul class="nav menu">
			<li class="active"><a href="getAllProviderByAdmin.action">查看所有供应商</a></li>
			<li><a href="listAllUNAUTHORIZED.action">认证供应商资格</a></li>
			<li><a href="setSecondKill.jsp">设置秒杀活动</a></li>
			<li role="presentation" class="divider"></li>
			<li><a href="logout.action">注销</a></li>
		</ul>
	</div>

	<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main"
		id="main">
		<ol class="breadcrumb">
			<li class="active"><img src="image/home.png" class="home">/&nbsp;&nbsp;所有供应商:</li>
		</ol>

		<div class="row">
			<div class="col-lg-12">
				<div class="panel-static panel-default">
					<div class="panel-heading">所有的供应商:</div>
					
					<div class="panel-body">
						<table border=1 bordercolor="#fff" style="width: 100%;" id="table">
							<tr>
								<th
									style="width: 5%; text-align: center; font-size: 14px; letter-spacing: 2px; background-color: #71BFFC;">ID号</th>
								<th
									style="width: 15%; text-align: center; font-size: 14px; letter-spacing: 2px; background-color: #71BFFC;">用户名</th>
								<th
									style="width: 7%; text-align: center; font-size: 14px; letter-spacing: 2px; background-color: #71BFFC;">密码</th>
								<th
									style="width: 20%; text-align: center; font-size: 14px; letter-spacing: 2px; background-color: #71BFFC;">名称</th>
								<th
									style="width: 10%; text-align: center; font-size: 14px; letter-spacing: 2px; background-color: #71BFFC;">状态</th>
								<th
									style="width: 10%; text-align: center; font-size: 14px; letter-spacing: 2px; background-color: #71BFFC;">服务等级</th>
								<th
									style="width: 15%; text-align: center; font-size: 14px; letter-spacing: 2px; background-color: #71BFFC;">电话</th>
								<th
									style="width: 30%; text-align: center; font-size: 14px; letter-spacing: 2px; background-color: #71BFFC;">操作</th>
							</tr>
							<page:pager dz="16">
							<s:iterator value="#session.AllProviderList" status="stat" id="list">
							<page:item nr="${stat.count}">
								<tr>
									<td align="center" style="font-size: 14px;"><s:property
											value="#list.id" /></td>
									<td align="center" style="font-size: 14px;"><s:property
											value="#list.username" /></td>
									<td align="center" style="font-size: 14px;"><s:property
											value="#list.password" /></td>
									<td align="center" style="font-size: 14px;"><s:property
											value="#list.name" /></td>
									<td align="center" style="font-size: 14px;">
<%-- 									<s:property value="#list.state" /> --%>
									<s:if test='#list.state.toString()=="STATE_UNAUTHORIZED"'>
 									未认证
									</s:if>
									<s:elseif test='#list.state.toString()=="STATE_PASSED"'>
 									认证通过
									</s:elseif>
									<s:elseif test='#list.state.toString()=="STATE_FAILED"'>
									认证失败 
									</s:elseif>	

											</td>
									<td align="center" style="font-size: 14px;"><s:property
											value="#list.rank" /></td>
									<td align="center" style="font-size: 14px;"><s:property
											value="#list.phone" /></td>
									<td align="center" style="font-size: 14px;"><s:a href="success.jsp">警示</s:a>/<s:a href="banProvider.action?provider.id=%{#list.id}" onclick="return check()">取消服务资格</s:a></td>
								</tr>

							
							
								</page:item>
							</s:iterator>
							</page:pager>
						</table>
					</div>
					<div align="center" style="padding-top: 20px">
						<page:bt />
					</div>
				</div>

			</div>
		</div>
		<!-- /.row -->

	</div>
	<!--/.main-->
	<script src="js/bootstrap.min.js"></script>
	<script src="js/jquery-1.11.1.min.js"></script>
	<script>$(document).ready(function () {
	    //奇偶行不同颜色
	    $("#table tbody tr:odd").addClass("odd"),
	    $("#table tbody tr:even").addClass("even"),
	    $("#table tr:gt(0)").hover(
	    	    function () { $(this).addClass("hover") },
	    	    function () { $(this).removeClass("hover") })
	});</script>
</body>
</html>